<meta charset="utf-8" />
<script>
iplist = getiplist();
for(var o=0;o<iplist.length;o++){
		console.log("ip"+iplist[o]);
}
function ipInfo(ip,type){  
	var reSpaceCheck = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
	if (reSpaceCheck.test(ip)){  
		ip.match(reSpaceCheck);  
		if (RegExp.$1<=255 && RegExp.$1>=0 && RegExp.$2<=255 && RegExp.$2>=0 &&RegExp.$3<=255 && RegExp.$3>=0 &&RegExp.$4<=255 && RegExp.$4>=0){  
			if(type == 0){
				return true;
			}else if(type == 1){
				return RegExp.$1;
			}else if(type == 2){
				return RegExp.$2;
			}else if(type == 3){
				return RegExp.$3;
			}else if(type == 4){
				return RegExp.$4;
			}else{
				return false;
			}
		}else{  
			return false;  
		}
	}else{
		return false;
	}
}
/**
 * 传入一个起始ip 一个结束ip 返回一个ip列表
 * 起始ip不能比结束ip大
 * 必须是正常的ip
 * 失败返回false
 */
function getiplist(){
	var start = "192.168.1.10";
	var end = "192.168.1.255";
	if(ipInfo(start,0) && ipInfo(end,0) && parseInt(ipInfo(end,4))>parseInt(ipInfo(start,4)) && ipInfo(start,1) == ipInfo(end,1) && ipInfo(start,2) == ipInfo(end,2) && ipInfo(start,3) == ipInfo(end,3)){
		var iplist = [];
		var id = 0;
		for (var i=parseInt(ipInfo(start,4));i<parseInt(ipInfo(end,4))+1;i++){
			iplist[id] = ipInfo(start,1) + "." + ipInfo(start,2) + "." + ipInfo(start,3) + "." + i;
			id ++;
		}
		return iplist;
	}else{
		return false;
	}
}
</script>